package com.example.myapplication;

import com.danikula.videocache.file.Md5FileNameGenerator;
import com.example.myapplication.util.MD5Utils;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

/**
 * @author: rongfeng
 * @date: 2020/12/1
 * @description
 */
public class UpdateNname {


    public static void main(String[] args) {
        String path = "D:\\BaiduNetdiskDownload\\peppa pig1\\json";
        File file = new File(path);
        File[] list = file.listFiles();

        File outFile = new File(path);

        if (!outFile.isDirectory()) {
            outFile.mkdir();
        }

        // 如果目录下文件存在
        if (file.exists() && file.isDirectory()) {
            for (int i = 0; i < list.length; i++) {

                //取文件名子存入name中
                String name = list[i].getName();
//
                name = MD5Utils.createMD532("wrf_cpdc_srt" + name.replace(".json", ""));
                System.out.println(i);
////
//                name = name.replace(" - 副本", "_zh");
//////
//////                //重命名
                File dest = new File(path + "/" + name + ".json");
                list[i].renameTo(dest);


            }
        }
    }


    static class Bean implements Serializable {
        public String videoName;
    }


}
